﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Inventory
{
    /// <summary>
    /// Interaction logic for dlgIntentoryHistory.xaml
    /// </summary>
    public partial class dlgIntentoryHistory : Window
    {
        private tblInventory _inventory;
        private SalesManagerEntities _context;
        private CollectionViewSource _inventoryHistoryViewSource;

        public dlgIntentoryHistory(SalesManagerEntities context, tblInventory inventory)
        {
            InitializeComponent();
            _context = context;
            _inventory = inventory;
            _inventoryHistoryViewSource = (CollectionViewSource)FindResource("InventoryHistory");
            _inventoryHistoryViewSource.Source = (from c in _context.tblInventoryTransactionHistory
                                                  .Include("PriorInventoryTransactionStatus")
                                                  .Include("NewInventoryTransactionStatus")
                                                  where c.InventoryTransaction.Inventory.InventoryID == inventory.InventoryID
                                                  select c);
        }
    }
}
